#include <iostream>
#include <vector>

using namespace std;

// 2466. 统计构造好字符串的方案数
// https://leetcode.cn/problems/count-ways-to-build-good-strings/description/

class Solution {
    int mod = 1000000007;

public: 
    int countGoodStrings(int low, int high, int zero, int one) {
        vector<long long> dp(high + 1);
        dp[0] = 1;
        for (int i = min(zero, one); i <= high; i++){
            long long pre1 = 0;
            long long pre2 = 0;
            if (i - zero >= 0)
            {
                pre1 = dp[i - zero];
            }
            if(i - one >= 0){
                pre2 = dp[i - one];
            }
            dp[i] = (pre1 + pre2) % mod;
        }
        long long ans = 0;
        for (int i = low; i <= high; i++)
        {
            ans = (ans + dp[i]) % mod;
        }

        return ans;
    }
};

int main()
{
    return 0;
}